FROM openjdk:8-alpine3.9
# 作者信息
MAINTAINER laosiji Docker skywalking springboot "laosiji@lagou.com"
# 修改源
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories && \
    echo "http://mirrors.aliyun.com/alpine/latest-stable/community/" >> /etc/apk/repositories

# 安装需要的软件，解决时区问题
RUN apk --update add curl bash tzdata && \
    rm -rf /var/cache/apk/*

#修改镜像为东八区时间
ENV TZ Asia/Shanghai

VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} /app.jar
COPY agent/ /opt/skyagent
EXPOSE 8081

ENV JAVA_OPTS="-server -Xmx256m -Xms256m" AGENT_SERVICE_NAME="default" AGENT_COLLETOR_ADDRESS="192.168.198.141:11800"
ENTRYPOINT java -javaagent:/opt/skyagent/skywalking-agent.jar=agent.service_name=${AGENT_SERVICE_NAME},collector.backend_service=${AGENT_COLLETOR_ADDRESS} ${JAVA_OPTS} -jar /app.jar